//
//  ServiceUserNew.h
//  suRead
//
//  Created by colin on 2020/1/3.
//  Copyright © 2020 bao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

typedef NS_ENUM(NSInteger, AddScoreType) {
    AddScoreType_Login = 0,
    AddScoreType_clickadv,
    AddScoreType_clickrmt,
    AddScoreType_baoliao,
    AddScoreType_share,
    AddScoreType_comment,
    AddScoreType_star,
    AddScoreType_News
};

// 测试环境接口 账号：15527771471 密码：123456 等下给注册接口
static NSString *base_url = @"http://xcx.abcvote.cn";

@interface ServiceUserNew : NSObject

+ (NSURLSessionDataTask *)doLogin:(NSString *)phoneNum_
                            password:(NSString *)password_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetPhoneCode:(NSString *)phoneNum_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doRegister:(NSString *)phoneNum_
                              password:(NSString *)password_
                              code:(NSString *)code_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doUpload:(NSString *)imgPath
                           success:(void (^)(id responseObject,NSString *message))success_
                           failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doForgotPassword:(NSString *)phone
                                  new_pwd:(NSString *)new_pwd
                                  new_pwd2:(NSString *)new_pwd2
                                      code:(NSString *)code
                                   success:(void (^)(id responseObject,NSString *message))success_
                                   failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doModifyUserInfo:(NSString *)nick_name
                                     cover:(NSString *)cover
                                       sex:(NSInteger)sex
                                   success:(void (^)(id responseObject,NSString *message))success_
                                   failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doLoginLog:(NSString *)phoneNum_
                            location:(CLLocationCoordinate2D )location
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doLogNews:(NSString *)article_id
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetViewedNews:(NSInteger)pageNum
                                 pageSize:(NSInteger)pageSize
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetArea:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetAreaNews:(NSString *)areaId
                                pageNum:(NSInteger)pageNum
                               pageSize:(NSInteger)pageSize
                                success:(void (^)(id responseObject,NSString *message))success_
                                failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doLike:(NSString *)article_id
                         success:(void (^)(id responseObject,NSString *message))success_
                         failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doUnLike:(NSString *)article_id
                           success:(void (^)(id responseObject,NSString *message))success_
                           failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetLikeList:(NSInteger)pageNum
                               pageSize:(NSInteger)pageSize
                                success:(void (^)(id responseObject,NSString *message))success_
                                failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetComments:(NSString *)article_id
                                success:(void (^)(id responseObject,NSString *message))success_
                                failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doAddScore:(AddScoreType)type
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doQueryScore:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetRecommids:(CLLocationCoordinate2D )location
                                 success:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doSendComment:(NSString *)article_id
                               content:(NSString *)content
                               pid:(NSString *)pid
                               to_id:(NSString *)to_id
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doGetMyComments:(NSInteger)pageNum
                                 pageSize:(NSInteger)pageSize
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;
@end
